<?php
/**
 * Created by Zend Studio.
 * User: FDG348
 * Date: 2017/9/13
 * Time: 11:36
 */
namespace common\models;

use yii\db\ActiveRecord;

class ServiceVip extends ActiveRecord{
    const STATUS_ENABLE = 1;
    const STATUS_DISABLE = 0;

    public static function tableName(){
        return '{{%service_vip}}';
    }

    public function rules(){
        return [
            ['status','default','value'=>self::STATUS_DISABLE],
            ['creator','getCreator'],
        ];
    }

    /**
     * @获取创建人
     */
    public function getCreator(){
        $userInfo = \common\helps\tools::getloginUserInfo();
        if($userInfo){
            $userName = $userInfo->userName;
        }else{
            $userName = '';
        }
        return $userName;
    }
}